package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.bo.CreditQueryApplyBO;
import com.mhc.suzuki.dal.mapper.ext.CreditQueryApplyExtMapper;
import com.mhc.suzuki.dal.model.CreditQueryApplyDO;
import com.mhc.suzuki.dal.query.CreditQueryApplyQuery;
import com.mhc.suzuki.manager.CreditQueryApplyManager;
import com.mhc.suzuki.vo.CreditExcelVO;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for CreditQueryApply.
 */

@Component
public class CreditQueryApplyManagerImpl implements CreditQueryApplyManager {


    @Autowired
    protected CreditQueryApplyExtMapper creditQueryApplyExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(CreditQueryApplyQuery query) {
        return creditQueryApplyExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(CreditQueryApplyQuery query) {
        return creditQueryApplyExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(CreditQueryApplyDO record) {
        return creditQueryApplyExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(CreditQueryApplyDO record) {
        return creditQueryApplyExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<CreditQueryApplyDO> selectByQuery(CreditQueryApplyQuery query) {
        return creditQueryApplyExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<CreditQueryApplyDO> selectByQueryWithPage(CreditQueryApplyQuery query) {
        PageResult<CreditQueryApplyDO> result = new PageResult<CreditQueryApplyDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public CreditQueryApplyDO selectByPrimaryKey(Long id) {
        return creditQueryApplyExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(CreditQueryApplyDO record, CreditQueryApplyQuery query) {
        return creditQueryApplyExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(CreditQueryApplyDO record, CreditQueryApplyQuery query) {

        return creditQueryApplyExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(CreditQueryApplyDO record) {
        return creditQueryApplyExtMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<CreditExcelVO> selectByOrderNOList(List<String> list) {
        return creditQueryApplyExtMapper.selectByOrderNOList(list);
    }

    @Override
    public List<CreditQueryApplyBO> selectByCreditInfo(String orderNo) {
        return creditQueryApplyExtMapper.selectByCreditInfo(orderNo);
    }
}
